home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-15 | 1.3 KB | 51 lines | [TEXT/ToyS] |
- -- define the standard HTTP header
- set LF to ASCII character (10)
- set CR to return
- set CRLF to CR & LF
- set http_10_header to "HTTP/1.0 200 OK" & CRLF & ¬
- "Server: MacHTTP" & CRLF & ¬
- "MIME-Version: 1.0" & CRLF & ¬
- "Content-type: text/html" & CRLF & CRLF
-
- if http_search_args = "" then
-
- -- http_search_args is empty; request input via ISINDEX
- return http_10_header & ¬
- "<html>" & ¬
- "<head>" & ¬
- "<title>Hello!</title>" & ¬
- "<isindex>" & ¬
- "</head>" & ¬
- "<body>Hello! What is your name?" & ¬
- "</body>" & ¬
- "</html>"
-
- else
-
- -- http_search_args has value; return all variables
- return http_10_header & ¬
- "<html>" & ¬
- "<head>" & ¬
- "<title>Hello!</title>" & ¬
- "</head>" & ¬
- "<body>Hello!" & ¬
- "<p>http_search_args: " & http_search_args & ¬
- "<br>path_args: " & path_args & ¬
- "<br>post_args: " & post_args & ¬
- "<br>method: " & method & ¬
- "<br>client_address: " & client_address & ¬
- "<br>username:" & username & ¬
- "<br>password: " & password & ¬
- "<br>from_user:" & from_user & ¬
- "<br>server_name:" & server_name & ¬
- "<br>server_port:" & server_port & ¬
- "<br>script_name: " & script_name & ¬
- "<br>content_type: " & content_type & ¬
- "<br>referer: " & referer & ¬
- "<br>user_agent: " & user_agent & ¬
- "</body>" & ¬
- "</html>"
-
- end if
-
-